<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // n的阶乘等于n-1的阶乘来乘以n

    function jc (n) {
      if (n === 1) return 1
      return jc(n-1) * n

      // 也可以使用三元运算符一句话写完
      // return n === 1 ? 1 : jc(n-1) * n
    }

    console.log(jc(100))

  </script>
</body>
</html>